import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Category from '@/views/Category.vue'
import Cart from '@/views/Cart.vue'
import My from '@/views/My.vue'
import GoodsDetail from '@/views/goodsDetail.vue'
import App from '@/App.vue'
import Login from '@/views/Login.vue'

const router = createRouter({
	history: createWebHistory(import.meta.env.BASE_URL),
	routes: [
		{
			path: '/',
			redirect: '/home',
			component: App,
			children: [
				{
					path: '/home',
					component: HomeView,
				},
				{
					path: '/category',
					component: Category,
				},
				{
					path: '/cart',
					component: Cart,
				},
				{
					path: '/my',
					component: My,
				},
			],
		},

		{
			path: '/detail',
			component: GoodsDetail,
		},
		{
			path:'/login',
			component:Login
		}
	],
})

export default router
